import {
  Controller,
  Get,
  Param,
  UseGuards,
  Query,
  DefaultValuePipe,
  ParseIntPipe,
} from '@nestjs/common';
import { MercadoproductService } from 'src/service/mercadoproduct.service';
import { AuthGuard } from 'src/guards/auth.guard';
import { QueryMercadoproductDto } from 'src/dto/query-mercadoproduct.dto';

@Controller('api/mercadoproduct')
@UseGuards(AuthGuard)
export class MercadoproductApiController {
  constructor(private readonly mercadoproductService: MercadoproductService) {}

  @Get()
  findAll(@Query() query: QueryMercadoproductDto) {
    return this.mercadoproductService.query(query);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.mercadoproductService.findOne(+id);
  }

}
